import React from "react";
import { useLocation, useSearchParams } from "react-router-dom";
import styles from "./css/order.module.css";
import Navbar from "../../components/navbar";
import TicketCard from "../train/components/TicketCard";
import OrderFooter from "./components/OrderFooter";
import ChoosePer from "./components/ChoosePer";
import ChooseSeat from "./components/ChooseSeat";
import { Form } from "antd-mobile";
import { FormContent } from "./Fform.js";
function Index() {
  let loca = useLocation();
  let info = loca.state;
  let [sp] = useSearchParams();
  let [form] = Form.useForm();
  return (
    <FormContent.Provider value={form}>
      <div className={styles.box}>
        <Navbar title="订单填写" />
        <TicketCard {...info} />
        <div className={styles.type}>
          <span>坐席</span>
          <span>
            <span>{sp.get("seatType")}</span>
            <span className={styles.price}>￥{sp.get("price")}</span>
          </span>
        </div>
        <ChoosePer />
        <ChooseSeat />
        <div>
          <OrderFooter {...info} />
        </div>
      </div>
    </FormContent.Provider>
  );
}

export default Index;
